home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / PictUtil.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  5.4 KB  |  180 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        PictUtil.p
  3.  
  4.     Contains:    The pascal interface file for the picture utilities package.
  5.  
  6.     Copyright:    © 1990 by Apple Computer, Inc., all rights reserved.
  7.  
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT PictUtil;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingPictUtil}
  21. {$SETC UsingPictUtil := 1}
  22.  
  23. {$I+}
  24. {$SETC PictUtilIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingTypes}
  27. {$I $$Shell(PInterfaces)Types.p}
  28. {$ENDC}
  29. {$IFC UNDEFINED UsingQuickdraw}
  30. {$I $$Shell(PInterfaces)Quickdraw.p}
  31. {$ENDC}
  32. {$IFC UNDEFINED UsingPalettes}
  33. {$I $$Shell(PInterfaces)Palettes.p}
  34. {$ENDC}
  35. {$SETC UsingIncludes := PictUtilIncludes}
  36.  
  37.  
  38. {----------------------------------------------------------------------------------------------------------}
  39.  
  40. CONST
  41.  
  42. {verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls}
  43.  
  44. returnColorTable        =  1;
  45. returnPalette            =  2;
  46. recordComments            =  4;
  47. recordFontInfo            =  8;
  48. suppressBlackAndWhite    = 16;
  49.  
  50.  
  51. {color pick methods}
  52.  
  53. systemMethod            = 0;    {system color pick method}
  54. popularMethod            = 1;    {method that chooses the most popular set of colors}
  55. medianMethod            = 2;    {method that chooses a good average mix of colors}
  56.  
  57.  
  58. {color bank types}
  59.  
  60. ColorBankIsCustom        = -1;
  61. ColorBankIsExactAnd555    =  0;
  62. ColorBankIs555            =  1;
  63.  
  64.  
  65. {----------------------------------------------------------------------------------------------------------}
  66.  
  67. TYPE
  68.  
  69.  
  70. PictInfoID = LONGINT;
  71.  
  72.  
  73. CommentSpecHandle = ^CommentSpecPtr;
  74. CommentSpecPtr = ^CommentSpec;
  75. CommentSpec = RECORD
  76.     count:                INTEGER;                    {number of occurrances of this comment ID}
  77.     ID:                    INTEGER;                     {ID for the comment in the picture}
  78. END;
  79.  
  80.  
  81. FontSpecHandle = ^FontSpecPtr;
  82. FontSpecPtr = ^FontSpec;
  83. FontSpec = RECORD
  84.     pictFontID:            INTEGER;                    {ID of the font in the picture}
  85.     sysFontID:            INTEGER;                     {ID of the same font in the current system file}
  86.     size:                ARRAY [0..3] OF LONGINT;    {bit array of all the sizes found (1..127) (bit 0 means > 127)}
  87.     style:                INTEGER;                     {combined style of all occurrances of the font}
  88.     nameOffset:            LONGINT;                     {offset into the fontNamesHdl handle for the font’s name}
  89. END;
  90.  
  91.  
  92. PictInfoHandle = ^PictInfoPtr;
  93. PictInfoPtr = ^PictInfo;
  94. PictInfo = RECORD
  95.     version:            INTEGER;                    {this is always zero, for now}
  96.     uniqueColors:        LONGINT;                    {the number of actual colors in the picture(s)/pixmap(s)}
  97.     thePalette:            PaletteHandle;                {handle to the palette information}
  98.     theColorTable:        CTabHandle;                    {handle to the color table}
  99.     hRes:                Fixed;                        {maximum horizontal resolution for all the pixmaps}
  100.     vRes:                Fixed;                        {maximum vertical resolution for all the pixmaps}
  101.     depth:                INTEGER;                    {maximum depth for all the pixmaps (in the picture)}
  102.     sourceRect:            Rect;                        {the picture frame rectangle (this contains the entire picture)}
  103.     textCount:            LONGINT;                    {total number of text strings in the picture}
  104.     lineCount:            LONGINT;                    {total number of lines in the picture}
  105.     rectCount:            LONGINT;                    {total number of rectangles in the picture}
  106.     rRectCount:            LONGINT;                    {total number of round rectangles in the picture}
  107.     ovalCount:            LONGINT;                    {total number of ovals in the picture}
  108.     arcCount:            LONGINT;                    {total number of arcs in the picture}
  109.     polyCount:            LONGINT;                    {total number of polygons in the picture}
  110.     regionCount:        LONGINT;                    {total number of regions in the picture}
  111.     bitMapCount:        LONGINT;                    {total number of bitmaps in the picture}
  112.     pixMapCount:        LONGINT;                    {total number of pixmaps in the picture}
  113.     commentCount:        LONGINT;                    {total number of comments in the picture}
  114.     uniqueComments:        LONGINT;                    {the number of unique comments in the picture}
  115.     commentHandle:        CommentSpecHandle;            {handle to all the comment information}
  116.     uniqueFonts:        LONGINT;                    {the number of unique fonts in the picture}
  117.     fontHandle:            FontSpecHandle;                {handle to the FontSpec information}
  118.     fontNamesHandle:    Handle;                        {handle to the font names}
  119.     reserved1:            LONGINT;
  120.     reserved2:            LONGINT;
  121. END;
  122.  
  123.  
  124. {----------------------------------------------------------------------------------------------------------}
  125.  
  126.  
  127. FUNCTION GetPictInfo        (    thePictHandle:        PicHandle;
  128.                             VAR thePictInfo:        PictInfo;
  129.                                 verb:                 INTEGER;
  130.                                 colorsRequested:    INTEGER;
  131.                                 colorPickMethod:    INTEGER;
  132.                                 version:             INTEGER
  133.                             ): OSErr;    INLINE $303C,$0800,$A831;
  134.  
  135.  
  136. FUNCTION GetPixMapInfo        (    thePixMapHandle:    PixMapHandle;
  137.                             VAR    thePictInfo:        PictInfo;
  138.                                 verb:                INTEGER;
  139.                                 colorsRequested:    INTEGER;
  140.                                 colorPickMethod:    INTEGER;
  141.                                 version:            INTEGER
  142.                             ): OSErr;    INLINE $303C,$0801,$A831;
  143.  
  144.  
  145. FUNCTION NewPictInfo        (VAR thePictInfoID:        PictInfoID;
  146.                                 verb:                INTEGER;
  147.                                 colorsRequested:    INTEGER;
  148.                                 colorPickMethod:    INTEGER;
  149.                                 version:            INTEGER
  150.                             ): OSErr;    INLINE $303C,$0602,$A831;
  151.  
  152.  
  153. FUNCTION RecordPictInfo        (    thePictInfoID:        PictInfoID;
  154.                                 thePictHandle:        PicHandle
  155.                             ): OSErr;    INLINE $303C,$0403,$A831;
  156.  
  157.  
  158. FUNCTION RecordPixMapInfo    (    thePictInfoID:        PictInfoID;
  159.                                 thePixMapHandle:    PixMapHandle
  160.                             ): OSErr;    INLINE $303C,$0404,$A831;
  161.  
  162.  
  163. FUNCTION RetrievePictInfo    (    thePictInfoID:        PictInfoID;
  164.                             VAR    thePictInfo:        PictInfo;
  165.                                 colorsRequested:    INTEGER
  166.                             ): OSErr;    INLINE $303C,$0505,$A831;
  167.  
  168.  
  169. FUNCTION DisposPictInfo        (    thePictInfoID:        PictInfoID
  170.                             ): OSErr;    INLINE $303C,$0206,$A831;
  171.  
  172.  
  173. {----------------------------------------------------------------------------------------------------------}
  174.  
  175. {$ENDC}    { UsingPictUtil }
  176.  
  177. {$IFC NOT UsingIncludes}
  178.     END.
  179. {$ENDC}
  180.